home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Help / First Page 2006 User Guide.chm / overlib.js < prev    next >
Text File  |  2005-11-29  |  45KB  |  1,337 lines

  1. //\/////
  2. //\  overLIB 4.07 - You may not remove or change this notice.
  3. //\  Copyright Erik Bosrup 1998-2004. All rights reserved.
  4. //\
  5. //\  Contributors are listed on the homepage.
  6. //\  This file might be old, always check for the latest version at:
  7. //\  http://www.bosrup.com/web/overlib/
  8. //\
  9. //\  Please read the license agreement (available through the link above)
  10. //\  before using overLIB. Direct any licensing questions to erik@bosrup.com.
  11. //\
  12. //\  Do not sell this as your own work or remove this copyright notice. 
  13. //\  For full details on copying or changing this script please read the
  14. //\  license agreement at the link above. Please give credit on sites that
  15. //\  use overLIB and submit changes of the script so other people can use
  16. //\  them as well.
  17. //   $Revision: 1.68.2.1.2.15.2.2 $                $Date: 2004/09/24 20:31:28 $
  18. //\/////
  19. //\mini
  20.  
  21. ////////
  22. // PRE-INIT
  23. // Ignore these lines, configuration is below.
  24. ////////
  25. var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1;  var pms = new Array(); var olInfo = new Info('4.07', 1);
  26. var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3;
  27. var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+ 
  28. registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass');
  29.  
  30. ////////
  31. // DEFAULT CONFIGURATION
  32. // Settings you want everywhere are set here. All of this can also be
  33. // changed on your html page or through an overLIB call.
  34. ////////
  35. if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#CCCCFF";
  36. if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#333399";
  37. if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
  38. if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF";
  39. if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF";
  40. if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
  41. if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
  42. if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
  43. if (typeof ol_textsize=='undefined') var ol_textsize="1";
  44. if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
  45. if (typeof ol_closesize=='undefined') var ol_closesize="1";
  46. if (typeof ol_width=='undefined') var ol_width="200";
  47. if (typeof ol_border=='undefined') var ol_border="1";
  48. if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
  49. if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
  50. if (typeof ol_offsety=='undefined') var ol_offsety=10;
  51. if (typeof ol_text=='undefined') var ol_text="Default Text";
  52. if (typeof ol_cap=='undefined') var ol_cap="";
  53. if (typeof ol_sticky=='undefined') var ol_sticky=0;
  54. if (typeof ol_background=='undefined') var ol_background="";
  55. if (typeof ol_close=='undefined') var ol_close="Close";
  56. if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
  57. if (typeof ol_status=='undefined') var ol_status="";
  58. if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
  59. if (typeof ol_height=='undefined') var ol_height=-1;
  60. if (typeof ol_snapx=='undefined') var ol_snapx=0;
  61. if (typeof ol_snapy=='undefined') var ol_snapy=0;
  62. if (typeof ol_fixx=='undefined') var ol_fixx=-1;
  63. if (typeof ol_fixy=='undefined') var ol_fixy=-1;
  64. if (typeof ol_relx=='undefined') var ol_relx=null;
  65. if (typeof ol_rely=='undefined') var ol_rely=null;
  66. if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
  67. if (typeof ol_bgbackground=='undefined') var ol_bgbackground="";
  68. if (typeof ol_padxl=='undefined') var ol_padxl=1;
  69. if (typeof ol_padxr=='undefined') var ol_padxr=1;
  70. if (typeof ol_padyt=='undefined') var ol_padyt=1;
  71. if (typeof ol_padyb=='undefined') var ol_padyb=1;
  72. if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
  73. if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
  74. if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
  75. if (typeof ol_capicon=='undefined') var ol_capicon="";
  76. if (typeof ol_frame=='undefined') var ol_frame=self;
  77. if (typeof ol_timeout=='undefined') var ol_timeout=0;
  78. if (typeof ol_function=='undefined') var ol_function=null;
  79. if (typeof ol_delay=='undefined') var ol_delay=0;
  80. if (typeof ol_hauto=='undefined') var ol_hauto=0;
  81. if (typeof ol_vauto=='undefined') var ol_vauto=0;
  82. if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
  83. if (typeof ol_wrap=='undefined') var ol_wrap=0;
  84. if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
  85. if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
  86. if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
  87. if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
  88. if (typeof ol_css=='undefined') var ol_css=CSSOFF;
  89. if (typeof ol_fgclass=='undefined') var ol_fgclass="";
  90. if (typeof ol_bgclass=='undefined') var ol_bgclass="";
  91. if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
  92. if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
  93. if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";
  94.  
  95. ////////
  96. // ARRAY CONFIGURATION
  97. ////////
  98.  
  99. // You can use these arrays to store popup text here instead of in the html.
  100. if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
  101. if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");
  102.  
  103. ////////
  104. // END OF CONFIGURATION
  105. // Don't change anything below this line, all configuration is above.
  106. ////////
  107.  
  108.  
  109.  
  110.  
  111.  
  112. ////////
  113. // INIT
  114. ////////
  115. // Runtime variables init. Don't change for config!
  116. var o3_text="";
  117. var o3_cap="";
  118. var o3_sticky=0;
  119. var o3_background="";
  120. var o3_close="Close";
  121. var o3_hpos=RIGHT;
  122. var o3_offsetx=2;
  123. var o3_offsety=2;
  124. var o3_fgcolor="";
  125. var o3_bgcolor="";
  126. var o3_textcolor="";
  127. var o3_capcolor="";
  128. var o3_closecolor="";
  129. var o3_width=100;
  130. var o3_border=1;
  131. var o3_cellpad=2;
  132. var o3_status="";
  133. var o3_autostatus=0;
  134. var o3_height=-1;
  135. var o3_snapx=0;
  136. var o3_snapy=0;
  137. var o3_fixx=-1;
  138. var o3_fixy=-1;
  139. var o3_relx=null;
  140. var o3_rely=null;
  141. var o3_fgbackground="";
  142. var o3_bgbackground="";
  143. var o3_padxl=0;
  144. var o3_padxr=0;
  145. var o3_padyt=0;
  146. var o3_padyb=0;
  147. var o3_fullhtml=0;
  148. var o3_vpos=BELOW;
  149. var o3_aboveheight=0;
  150. var o3_capicon="";
  151. var o3_textfont="Verdana,Arial,Helvetica";
  152. var o3_captionfont="Verdana,Arial,Helvetica";
  153. var o3_closefont="Verdana,Arial,Helvetica";
  154. var o3_textsize="1";
  155. var o3_captionsize="1";
  156. var o3_closesize="1";
  157. var o3_frame=self;
  158. var o3_timeout=0;
  159. var o3_timerid=0;
  160. var o3_allowmove=0;
  161. var o3_function=null; 
  162. var o3_delay=0;
  163. var o3_delayid=0;
  164. var o3_hauto=0;
  165. var o3_vauto=0;
  166. var o3_closeclick=0;
  167. var o3_wrap=0;
  168. var o3_followmouse=1;
  169. var o3_mouseoff=0;
  170. var o3_closetitle='';
  171. var o3_compatmode=0;
  172. var o3_css=CSSOFF;
  173. var o3_fgclass="";
  174. var o3_bgclass="";
  175. var o3_textfontclass="";
  176. var o3_captionfontclass="";
  177. var o3_closefontclass="";
  178.  
  179. // Display state variables
  180. var o3_x = 0;
  181. var o3_y = 0;
  182. var o3_showingsticky = 0;
  183. var o3_removecounter = 0;
  184.  
  185. // Our layer
  186. var over = null;
  187. var fnRef, hoveringSwitch = false;
  188.  
  189. // Decide browser version
  190. var isMac = (navigator.userAgent.indexOf("Mac") != -1);
  191. var olOp=(navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode);  // Opera 7
  192. var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
  193. var olNs6 = (document.getElementById) ? true : false;
  194. var olIe4 = (document.all) ? true : false;
  195. var olIe5 = false; 
  196. var olIe55 = false; // Added additional variable to identify IE5.5+
  197. var docRoot = 'document.body';
  198.  
  199. // Resize fix for NS4.x to keep track of layer
  200. if (olNs4) {
  201.     var oW = window.innerWidth;
  202.     var oH = window.innerHeight;
  203.     window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
  204. }
  205.  
  206. // Microsoft Stupidity Check(tm).
  207. if (olIe4) {
  208.     var agent=navigator.userAgent;
  209.     if (/MSIE/.test(agent)) {
  210.         var versNum=parseFloat(agent.match(/MSIE (\d\.\d+)\.*/)[1]);
  211.         if (versNum >= 5){
  212.             olIe5=true;
  213.             olIe55=(versNum>=5.5&&!olOp) ? true : false;
  214.             if (olNs6) olNs6=false;
  215.         }
  216.     }
  217.     if (olNs6) olIe4=false;
  218. }
  219.  
  220. // Check for compatability mode.
  221. if (document.compatMode && document.compatMode == 'CSS1Compat') {
  222.     docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
  223. }
  224.  
  225. // Add window onload handlers to indicate when all modules have been loaded
  226. // For Netscape 6+ and Mozilla, uses addEventListener method on the window object
  227. // For IE it uses the attachEvent method of the window object
  228.  
  229. if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
  230. else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);
  231.  
  232. // Capture events, alt. diffuses the overlib function.
  233. var olCheckMouseCapture = true;
  234. if ((olNs4 || olNs6 || olIe4)) {
  235.     olMouseCapture();
  236. } else {
  237.     overlib = no_overlib;
  238.     nd = no_overlib;
  239.     ver3fix = true;
  240. }
  241.  
  242.  
  243. ////////
  244. // PUBLIC FUNCTIONS
  245. ////////
  246.  
  247. // overlib(arg0,...,argN)
  248. // Loads parameters into global runtime variables.
  249. function overlib() {
  250.     if (!olLoaded || isExclusive(overlib.arguments)) return true;
  251.     if (olCheckMouseCapture) olMouseCapture();
  252.     if (over) cClick();
  253.  
  254.     // Load defaults to runtime.
  255.     o3_text=ol_text;
  256.     o3_cap=ol_cap;
  257.     o3_sticky=ol_sticky;
  258.     o3_background=ol_background;
  259.     o3_close=ol_close;
  260.     o3_hpos=ol_hpos;
  261.     o3_offsetx=ol_offsetx;
  262.     o3_offsety=ol_offsety;
  263.     o3_fgcolor=ol_fgcolor;
  264.     o3_bgcolor=ol_bgcolor;
  265.     o3_textcolor=ol_textcolor;
  266.     o3_capcolor=ol_capcolor;
  267.     o3_closecolor=ol_closecolor;
  268.     o3_width=ol_width;
  269.     o3_border=ol_border;
  270.     o3_cellpad=ol_cellpad;
  271.     o3_status=ol_status;
  272.     o3_autostatus=ol_autostatus;
  273.     o3_height=ol_height;
  274.     o3_snapx=ol_snapx;
  275.     o3_snapy=ol_snapy;
  276.     o3_fixx=ol_fixx;
  277.     o3_fixy=ol_fixy;
  278.     o3_relx=ol_relx;
  279.     o3_rely=ol_rely;
  280.     o3_fgbackground=ol_fgbackground;
  281.     o3_bgbackground=ol_bgbackground;
  282.     o3_padxl=ol_padxl;
  283.     o3_padxr=ol_padxr;
  284.     o3_padyt=ol_padyt;
  285.     o3_padyb=ol_padyb;
  286.     o3_fullhtml=ol_fullhtml;
  287.     o3_vpos=ol_vpos;
  288.     o3_aboveheight=ol_aboveheight;
  289.     o3_capicon=ol_capicon;
  290.     o3_textfont=ol_textfont;
  291.     o3_captionfont=ol_captionfont;
  292.     o3_closefont=ol_closefont;
  293.     o3_textsize=ol_textsize;
  294.     o3_captionsize=ol_captionsize;
  295.     o3_closesize=ol_closesize;
  296.     o3_timeout=ol_timeout;
  297.     o3_function=ol_function;
  298.     o3_delay=ol_delay;
  299.     o3_hauto=ol_hauto;
  300.     o3_vauto=ol_vauto;
  301.     o3_closeclick=ol_closeclick;
  302.     o3_wrap=ol_wrap;    
  303.     o3_followmouse=ol_followmouse;
  304.     o3_mouseoff=ol_mouseoff;
  305.     o3_closetitle=ol_closetitle;
  306.     o3_css=ol_css;
  307.     o3_compatmode=ol_compatmode;
  308.     o3_fgclass=ol_fgclass;
  309.     o3_bgclass=ol_bgclass;
  310.     o3_textfontclass=ol_textfontclass;
  311.     o3_captionfontclass=ol_captionfontclass;
  312.     o3_closefontclass=ol_closefontclass;
  313.     
  314.     setRunTimeVariables();
  315.     
  316.     fnRef = '';
  317.     
  318.     // Special for frame support, over must be reset...
  319.     o3_frame = ol_frame;
  320.     
  321.     if (olNs4) {
  322.         over = o3_frame.document.layers['overDiv'];
  323.     } else if (document.all) {
  324.         over = o3_frame.document.all['overDiv'];
  325.     } else if (document.getElementById) {
  326.         over = o3_frame.document.getElementById("overDiv");
  327.     }
  328.  
  329.     parseTokens('o3_', overlib.arguments);
  330.     if (!postParseChecks()) return false;
  331.  
  332.     if (o3_delay == 0) {
  333.         return runHook("olMain", FREPLACE);
  334.      } else {
  335.         o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
  336.         return false;
  337.     }
  338. }
  339.  
  340. // Clears popups if appropriate
  341. function nd(time) {
  342.     if (olLoaded && !isExclusive()) {
  343.         if (time && !o3_delay) {
  344.             if (o3_timerid > 0) clearTimeout(o3_timerid);
  345.             
  346.             o3_timerid = setTimeout("cClick()",(o3_timeout = time));
  347.         }
  348.         if (o3_removecounter >= 1) { o3_showingsticky = 0 };
  349.         
  350.         if (o3_showingsticky == 0) {
  351.             o3_allowmove = 0;
  352.             if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
  353.         } else {
  354.             o3_removecounter++;
  355.         }
  356.     }
  357.     
  358.     return true;
  359. }
  360.  
  361. // The Close onMouseOver function for stickies
  362. function cClick() {
  363.     if (olLoaded) {
  364.         runHook("hideObject", FREPLACE, over);
  365.         o3_showingsticky = 0;    
  366.     }    
  367.     return false;
  368. }
  369.  
  370. // Method for setting page specific defaults.
  371. function overlib_pagedefaults() {
  372.     parseTokens('ol_', overlib_pagedefaults.arguments);
  373. }
  374.  
  375.  
  376. ////////
  377. // OVERLIB MAIN FUNCTION
  378. ////////
  379.  
  380. // This function decides what it is we want to display and how we want it done.
  381. function olMain() {
  382.     var layerhtml, styleType;
  383.      runHook("olMain", FBEFORE);
  384.      
  385.     if (o3_background!="" || o3_fullhtml) {
  386.         // Use background instead of box.
  387.         layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
  388.     } else {
  389.         // They want a popup box.
  390.         styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");
  391.  
  392.         // Prepare popup background
  393.         if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
  394.         if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);
  395.  
  396.         // Prepare popup colors
  397.         if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
  398.         if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);
  399.  
  400.         // Prepare popup height
  401.         if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
  402.         else o3_height = "";
  403.  
  404.         // Decide which kinda box.
  405.         if (o3_cap=="") {
  406.             // Plain
  407.             layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
  408.         } else {
  409.             // With caption
  410.             if (o3_sticky) {
  411.                 // Show close text
  412.                 layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
  413.             } else {
  414.                 // No close text
  415.                 layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
  416.             }
  417.         }
  418.     }    
  419.  
  420.     // We want it to stick!
  421.     if (o3_sticky) {
  422.         if (o3_timerid > 0) {
  423.             clearTimeout(o3_timerid);
  424.             o3_timerid = 0;
  425.         }
  426.         o3_showingsticky = 1;
  427.         o3_removecounter = 0;
  428.     }
  429.  
  430.     // Created a separate routine to generate the popup to make it easier
  431.     // to implement a plugin capability
  432.     if (!runHook("createPopup", FREPLACE, layerhtml)) return false;
  433.  
  434.     // Prepare status bar
  435.     if (o3_autostatus > 0) {
  436.         o3_status = o3_text;
  437.         if (o3_autostatus > 1) o3_status = o3_cap;
  438.     }
  439.  
  440.     // When placing the layer the first time, even stickies may be moved.
  441.     o3_allowmove = 0;
  442.  
  443.     // Initiate a timer for timeout
  444.     if (o3_timeout > 0) {          
  445.         if (o3_timerid > 0) clearTimeout(o3_timerid);
  446.         o3_timerid = setTimeout("cClick()", o3_timeout);
  447.     }
  448.  
  449.     // Show layer
  450.     runHook("disp", FREPLACE, o3_status);
  451.     runHook("olMain", FAFTER);
  452.  
  453.     return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
  454. }
  455.  
  456. ////////
  457. // LAYER GENERATION FUNCTIONS
  458. ////////
  459. // These functions just handle popup content with tags that should adhere to the W3C standards specification.
  460.  
  461. // Makes simple table without caption
  462. function ol_content_simple(text) {
  463.     txt='<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="' + o3_cellpad + '" cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' : '>')+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td></tr></table></td></tr></table>';
  464.  
  465.     set_background("");
  466.     return txt;
  467. }
  468.  
  469. // Makes table with caption and optional close link
  470. function ol_content_caption(text,title,close) {
  471.     var nameId;
  472.     closing="";
  473.     closeevent="onmouseover";
  474.     if (o3_closeclick==1) closeevent= (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
  475.     if (o3_capicon!="") {
  476.         nameId=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';
  477.         if (typeof o3_dragimg!='undefined'&&o3_dragimg) nameId=' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
  478.         o3_capicon='<img src=\"'+o3_capicon+'\"'+nameId+' />';
  479.     }
  480.  
  481.     if (close != "")
  482.         closing='<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent+'="return '+fnRef+'cClick();">'+(o3_closefontclass ? '' : wrapStr(0,o3_closesize,'close'))+close+(o3_closefontclass ? '' : wrapStr(1,o3_closesize,'close'))+'</a></td>';
  483.     txt='<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td'+(o3_captionfontclass ? ' class="'+o3_captionfontclass+'">' : '>')+(o3_captionfontclass ? '' : '<b>'+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass ? '' : wrapStr(1,o3_captionsize)+'</b>')+'</td>'+closing+'</tr></table><table width="100%" border="0" cellpadding="' + o3_cellpad + '" cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' :'>')+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '</td></tr></table></td></tr></table>';
  484.  
  485.     set_background("");
  486.     return txt;
  487. }
  488.  
  489. // Sets the background picture,padding and lots more. :)
  490. function ol_content_background(text,picture,hasfullhtml) {
  491.     if (hasfullhtml) {
  492.         txt=text;
  493.     } else {
  494.         txt='<table width="'+o3_width+'" border="0" cellpadding="0" cellspacing="0" height="'+o3_height+'"><tr><td colspan="3" height="'+o3_padyt+'"></td></tr><tr><td width="'+o3_padxl+'"></td><td valign="TOP" width="'+(o3_width-o3_padxl-o3_padxr)+(o3_textfontclass ? '" class="'+o3_textfontclass : '')+'">'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td><td width="'+o3_padxr+'"></td></tr><tr><td colspan="3" height="'+o3_padyb+'"></td></tr></table>';
  495.     }
  496.  
  497.     set_background(picture);
  498.     return txt;
  499. }
  500.  
  501. // Loads a picture into the div.
  502. function set_background(pic) {
  503.     if (pic == "") {
  504.         if (olNs4) {
  505.             over.background.src = null; 
  506.         } else if (over.style) {
  507.             over.style.backgroundImage = "none";
  508.         }
  509.     } else {
  510.         if (olNs4) {
  511.             over.background.src = pic;
  512.         } else if (over.style) {
  513.             over.style.backgroundImage = "url("+pic+")";
  514.         }
  515.     }
  516. }
  517.  
  518. ////////
  519. // HANDLING FUNCTIONS
  520. ////////
  521. var olShowId=-1;
  522.  
  523. // Displays the popup
  524. function disp(statustext) {
  525.     runHook("disp", FBEFORE);
  526.     
  527.     if (o3_allowmove == 0) {
  528.         runHook("placeLayer", FREPLACE);
  529.         (olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
  530.         o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
  531.     }
  532.     
  533.     runHook("disp", FAFTER);
  534.  
  535.     if (statustext != "") self.status = statustext;
  536. }
  537.  
  538. // Creates the actual popup structure
  539. function createPopup(lyrContent){
  540.     runHook("createPopup", FBEFORE);
  541.     
  542.     if (o3_wrap && !(olNs4 || olOp)) {
  543.         if (olIe4) {
  544.             over.style.pixelWidth = 0;
  545.         } else if (olNs6) {
  546.             repositionTo(over, 0, -over.offsetHeight);
  547.         }
  548.     }
  549.  
  550.     layerWrite(lyrContent);
  551.     
  552.     // Have to set o3_width for placeLayer() routine if o3_wrap is turned on
  553.     if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
  554.     
  555.     runHook("createPopup", FAFTER, lyrContent);
  556.  
  557.     return true;
  558. }
  559.  
  560. // Decides where we want the popup.
  561. function placeLayer() {
  562.     var placeX, placeY, widthFix = 0;
  563.     
  564.     // HORIZONTAL PLACEMENT
  565.     if (eval('o3_frame.'+docRoot) && eval("typeof o3_frame."+docRoot+".clientWidth=='number'") && eval('o3_frame.'+docRoot+'.clientWidth')) {
  566.         iwidth = eval('o3_frame.'+docRoot+'.clientWidth');
  567.     } else if (typeof(o3_frame.innerWidth) == 'number') {
  568.         widthFix = Math.ceil(1.2*(o3_frame.outerWidth - o3_frame.innerWidth));
  569.         iwidth = o3_frame.innerWidth;
  570.     }
  571.  
  572.     // Horizontal scroll offset
  573.     winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;
  574.     var parsedWidth = parseInt(o3_width);
  575.  
  576.     if (o3_fixx > -1 || o3_relx != null) {
  577.         // Fixed position
  578.         placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
  579.     } else {  
  580.         // If HAUTO, decide what to use.
  581.         if (o3_hauto == 1) {
  582.             if ((o3_x - winoffset) > (iwidth / 2)) {
  583.                 o3_hpos = LEFT;
  584.             } else {
  585.                 o3_hpos = RIGHT;
  586.             }
  587.         }          
  588.  
  589.         // From mouse
  590.         if (o3_hpos == CENTER) { // Center
  591.             placeX = o3_x+o3_offsetx-(parsedWidth/2);
  592.  
  593.             if (placeX < winoffset) placeX = winoffset;
  594.         }
  595.  
  596.         if (o3_hpos == RIGHT) { // Right
  597.             placeX = o3_x+o3_offsetx;
  598.  
  599.             if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
  600.                 placeX = iwidth+winoffset - parsedWidth - widthFix;
  601.                 if (placeX < 0) placeX = 0;
  602.             }
  603.         }
  604.         if (o3_hpos == LEFT) { // Left
  605.             placeX = o3_x-o3_offsetx-parsedWidth;
  606.             if (placeX < winoffset) placeX = winoffset;
  607.         }      
  608.  
  609.         // Snapping!
  610.         if (o3_snapx > 1) {
  611.             var snapping = placeX % o3_snapx;
  612.  
  613.             if (o3_hpos == LEFT) {
  614.                 placeX = placeX - (o3_snapx+snapping);
  615.             } else {
  616.                 // CENTER and RIGHT
  617.                 placeX = placeX+(o3_snapx - snapping);
  618.             }
  619.  
  620.             if (placeX < winoffset) placeX = winoffset;
  621.         }
  622.     }    
  623.  
  624.     // VERTICAL PLACEMENT
  625.     if (eval('o3_frame.'+docRoot) && eval("typeof o3_frame."+docRoot+".clientHeight=='number'") && eval('o3_frame.'+docRoot+'.clientHeight')) {
  626.         iheight = eval('o3_frame.'+docRoot+'.clientHeight');
  627.     } else if (typeof(o3_frame.innerHeight)=='number') {
  628.         iheight = o3_frame.innerHeight;
  629.     }
  630.  
  631.     // Vertical scroll offset
  632.     scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
  633.     var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));
  634.  
  635.     if (o3_fixy > -1 || o3_rely != null) {
  636.         // Fixed position
  637.         placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
  638.     } else {
  639.         // If VAUTO, decide what to use.
  640.         if (o3_vauto == 1) {  
  641.             if ((o3_y - scrolloffset) > (iheight/2)) {
  642.                 o3_vpos = ABOVE;
  643.             } else {
  644.                 o3_vpos = BELOW;
  645.             }
  646.         }
  647.  
  648.         // From mouse
  649.         if (o3_vpos == ABOVE) {
  650.             if (o3_aboveheight == 0) o3_aboveheight = parsedHeight; 
  651.  
  652.             placeY = o3_y - (o3_aboveheight+o3_offsety);
  653.             if (placeY < scrolloffset) placeY = scrolloffset;
  654.         } else {
  655.             // BELOW
  656.             placeY = o3_y+o3_offsety;
  657.         } 
  658.  
  659.         // Snapping!
  660.         if (o3_snapy > 1) {
  661.             var snapping = placeY % o3_snapy;              
  662.  
  663.             if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
  664.                 placeY = placeY - (o3_snapy+snapping);
  665.             } else {
  666.                 placeY = placeY+(o3_snapy - snapping);
  667.             }             
  668.  
  669.             if (placeY < scrolloffset) placeY = scrolloffset;
  670.         }
  671.     }
  672.  
  673.     // Actually move the object.
  674.     repositionTo(over, placeX, placeY);
  675. }
  676.  
  677. // Moves the layer
  678. function olMouseMove(e) {
  679.     var e = (e) ? e : event;
  680.  
  681.     if (e.pageX) {
  682.         o3_x = e.pageX;
  683.         o3_y = e.pageY;
  684.     } else if (e.clientX) {
  685.         o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
  686.         o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
  687.     }
  688.     
  689.     if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);
  690.  
  691.     // MouseOut handler
  692.     if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
  693.         cClick();
  694.         hoveringSwitch = !hoveringSwitch;
  695.     }
  696. }
  697.  
  698. // Fake function for 3.0 users.
  699. function no_overlib() { return ver3fix; }
  700.  
  701. // Capture the mouse and chain other scripts.
  702. function olMouseCapture() {
  703.     capExtent = document;
  704.     var fN, mseHandler = olMouseMove;
  705.     var re = /function[ ]+(\w+)\(/;
  706.     
  707.     if (document.onmousemove || (!olIe4 && window.onmousemove)) {
  708.         if (window.onmousemove) capExtent = window;
  709.         fN = capExtent.onmousemove.toString().match(re);
  710.  
  711.         if (fN || fN[1] == 'anonymous' || fN[1] == 'olMouseMove') {
  712.             olCheckMouseCapture = false;
  713.             return;
  714.         }
  715.         var str = fN[1]+'(e); ' + 'olMouseMove(e); ';
  716.         mseHandler = new Function('e', str);
  717.     }
  718.  
  719.     capExtent.onmousemove = mseHandler;
  720.     if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
  721. }
  722.  
  723.  
  724. ////////
  725. // PARSING FUNCTIONS
  726. ////////
  727.  
  728. // Does the actual command parsing.
  729. function parseTokens(pf, ar) {
  730.     // What the next argument is expected to be.
  731.     var v, mode=-1, par = (pf != 'ol_');    
  732.     var fnMark = (par && !ar.length ? 1 : 0);
  733.  
  734.     for (i = 0; i < ar.length; i++) {
  735.         if (mode < 0) {
  736.             // Arg is maintext,unless its a number between pmStart and pmUpper
  737.             // then its a command.
  738.             if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
  739.                 fnMark = (par ? 1 : 0);
  740.                 i--;   // backup one so that the next block can parse it
  741.             } else {
  742.                 switch(pf) {
  743.                     case 'ol_':
  744.                         ol_text = ar[i].toString();
  745.                         break;
  746.                     default:
  747.                         o3_text=ar[i].toString();  
  748.                 }
  749.             }
  750.             mode = 0;
  751.         } else {
  752.             // Note: NS4 doesn't like switch cases with vars.
  753.             if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
  754.             if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
  755.             if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
  756.             if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
  757.             if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
  758.             if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
  759.             if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
  760.             if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); continue; }
  761.             if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
  762.             if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
  763.             if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
  764.             if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
  765.             if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
  766.             if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
  767.             if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
  768.             if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
  769.             if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
  770.             if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
  771.             if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
  772.             if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
  773.             if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
  774.             if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
  775.             if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
  776.             if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
  777.             if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
  778.             if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
  779.             if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
  780.             if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
  781.             if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
  782.             if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
  783.             if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
  784.             if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
  785.             if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
  786.             if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
  787.             if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); continue; }
  788.             if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
  789.             if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
  790.             if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
  791.             if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
  792.             if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
  793.             if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
  794.             if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
  795.             if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
  796.             if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i];  opt_FUNCTION(v); } continue; }
  797.             if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
  798.             if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
  799.             if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
  800.             if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
  801.             if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
  802.             if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
  803.             if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff == 0) ? 1 : 0'); continue; }
  804.             if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
  805.             if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
  806.             if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
  807.             if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
  808.             if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
  809.             if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
  810.             if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
  811.             if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
  812.             i = parseCmdLine(pf, i, ar);
  813.         }
  814.     }
  815.  
  816.     if (fnMark && o3_function) o3_text = o3_function();
  817.     
  818.     if ((pf == 'o3_') && o3_wrap) {
  819.         o3_width = 0;
  820.         
  821.         if (olOp || (olIe4 && isMac)) {
  822.             var tReg=/<.*\n*>/ig;
  823.             if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, ' ');
  824.             if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, ' ');
  825.         }
  826.     }
  827.     if ((pf == 'o3_') && o3_sticky) {
  828.         if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
  829.         if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
  830.     }
  831. }
  832.  
  833.  
  834. ////////
  835. // LAYER FUNCTIONS
  836. ////////
  837.  
  838. // Writes to a layer
  839. function layerWrite(txt) {
  840.     txt += "\n";
  841.     if (olNs4) {
  842.         var lyr = o3_frame.document.overDiv.document
  843.         lyr.write(txt)
  844.         lyr.close()
  845.     } else if (typeof over.innerHTML != 'undefined') {
  846.         if (olIe5 && isMac) over.innerHTML = '';
  847.         over.innerHTML = txt;
  848.     } else {
  849.         range = o3_frame.document.createRange();
  850.         range.setStartAfter(over);
  851.         domfrag = range.createContextualFragment(txt);
  852.         
  853.         while (over.hasChildNodes()) {
  854.             over.removeChild(over.lastChild);
  855.         }
  856.         
  857.         over.appendChild(domfrag);
  858.     }
  859. }
  860.  
  861. // Make an object visible
  862. function showObject(obj) {
  863.     runHook("showObject", FBEFORE);
  864.  
  865.     var theObj=(olNs4 ? obj : obj.style);
  866.     theObj.visibility = 'visible';
  867.  
  868.     runHook("showObject", FAFTER);
  869. }
  870.  
  871. // Hides an object
  872. function hideObject(obj) {
  873.     runHook("hideObject", FBEFORE);
  874.  
  875.     var theObj=(olNs4 ? obj : obj.style);
  876.     if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
  877.     theObj.visibility = 'hidden';
  878.  
  879.     if (o3_timerid > 0) clearTimeout(o3_timerid);
  880.     if (o3_delayid > 0) clearTimeout(o3_delayid);
  881.  
  882.     o3_timerid = 0;
  883.     o3_delayid = 0;
  884.     self.status = "";
  885.  
  886.     if (obj.onmouseout || obj.onmouseover) {
  887.         if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
  888.         obj.onmouseout = obj.onmouseover = null;
  889.     }
  890.  
  891.     runHook("hideObject", FAFTER);
  892. }
  893.  
  894. // Move a layer
  895. function repositionTo(obj, xL, yL) {
  896.     var theObj=(olNs4 ? obj : obj.style);
  897.     theObj.left = xL + (!olNs4 ? 'px' : 0);
  898.     theObj.top = yL + (!olNs4 ? 'px' : 0);
  899. }
  900.  
  901. // Check position of cursor relative to overDiv DIVision; mouseOut function
  902. function cursorOff() {
  903.     var left = parseInt(over.style.left);
  904.     var top = parseInt(over.style.top);
  905.     var right=left+(over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
  906.     var bottom=top+(over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
  907.  
  908.     if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
  909.  
  910.     return false;
  911. }
  912.  
  913.  
  914. ////////
  915. // COMMAND FUNCTIONS
  916. ////////
  917.  
  918. // Calls callme or the default function.
  919. function opt_FUNCTION(callme) {
  920.     o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));
  921.  
  922.     return 0;
  923. }
  924.  
  925. // Handle hovering
  926. function opt_NOCLOSE(unused) {
  927.     if (!unused) o3_close = "";
  928.  
  929.     if (olNs4) {
  930.         over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
  931.         over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
  932.         over.onmouseout = cClick;
  933.     } else {
  934.         over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
  935.     }
  936.  
  937.     return 0;
  938. }
  939.  
  940. // Function to scan command line arguments for multiples
  941. function opt_MULTIPLEARGS(i, args, parameter) {
  942.   var k = i, l, re, pV, str = '';
  943.  
  944.   for(k=i; k<args.length; k++) {
  945.         str += args[k] + ',';
  946.         if(typeof args[k] == 'number'&&args[k]>pmStart) break;
  947.     }
  948.   if(k >= args.length) l = str.length-1;
  949.   else {
  950.     re = eval('/,' + args[k] + '/');
  951.     l = str.search(re);
  952.   }
  953.  
  954.     k--;  // reduce by one so the for loop this is in works correctly
  955.     str = str.substring(0, l);
  956.     pV = (olNs4&&/cellpad/i.test(parameter)) ? str.split(',')[0] : str;
  957.     eval(parameter + '="' + pV + '"');
  958.  
  959.     return k;
  960. }
  961.  
  962. // Remove   in texts when done.
  963. function nbspCleanup() {
  964.     if (o3_wrap && (olOp || (olIe4 && isMac))) {
  965.         o3_text = o3_text.replace(/\ /g, ' ');
  966.         o3_cap = o3_cap.replace(/\ /g, ' ');
  967.     }
  968. }
  969.  
  970. // Escape embedded single quotes in text strings
  971. function escSglQuote(str) {
  972.   return str.toString().replace(/'/g,"\\'");
  973. }
  974.  
  975. // Onload handler for window onload event
  976. function OLonLoad_handler(e) {
  977.     var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;
  978.  
  979.     if(!olLoaded) olLoaded=1;
  980.  
  981.   // Remove it for Gecko based browsers
  982.     if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
  983.     else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
  984.         window.detachEvent("onload",OLonLoad_handler);
  985.         var fN = document.body.getAttribute('onload');
  986.         if (fN) {
  987.             fN=fN.toString().match(re);
  988.             if (fN && fN.length) {
  989.                 for (i=0; i<fN.length; i++) {
  990.                     if (/anonymous/.test(fN[i])) continue;
  991.                     while((l=fN[i].search(/\)[;\s]+/)) != -1) {
  992.                         fn=fN[i].substring(0,l+1);
  993.                         fN[i] = fN[i].substring(l+2);
  994.                         if (olre.test(fn)) eval(fn);
  995.                     }
  996.                 }
  997.             }
  998.         }
  999.     }
  1000. }
  1001.  
  1002. // Wraps strings in Layer Generation Functions with the correct tags
  1003. //    endWrap true(if end tag) or false if start tag
  1004. //    fontSizeStr - font size string such as '1' or '10px'
  1005. //    whichString is being wrapped -- 'text', 'caption', or 'close'
  1006. function wrapStr(endWrap,fontSizeStr,whichString) {
  1007.     var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
  1008.     fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
  1009.     if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
  1010.     else {
  1011.         fontStr='o3_'+whichString+'font';
  1012.         fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
  1013.         return (hasDims&&!olNs4) ? (isClose ? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">') : '<font face="'+eval(fontStr)+'" color="'+eval(fontColor)+'" size="'+(parseInt(fontSizeStr)>7 ? '7' : fontSizeStr)+'">';
  1014.     }
  1015. }
  1016.  
  1017. // Quotes Multi word font names; needed for CSS Standards adherence in font-family
  1018. function quoteMultiNameFonts(theFont) {
  1019.     var v, pM=theFont.split(',');
  1020.     for (var i=0; i<pM.length; i++) {
  1021.         v=pM[i];
  1022.         v=v.replace(/^\s+/,'').replace(/\s+$/,'');
  1023.         if(/\s/.test(v) && !/['"]/.test(v)) {
  1024.             v="\'"+v+"\'";
  1025.             pM[i]=v;
  1026.         }
  1027.     }
  1028.     return pM.join();
  1029. }
  1030.  
  1031. // dummy function which will be overridden 
  1032. function isExclusive(args) {
  1033.     return false;
  1034. }
  1035. ////////
  1036. //  PLUGIN ACTIVATION FUNCTIONS
  1037. ////////
  1038.  
  1039. // Runs plugin functions to set runtime variables.
  1040. function setRunTimeVariables(){
  1041.     if (typeof runTime != 'undefined' && runTime.length) {
  1042.         for (var k = 0; k < runTime.length; k++) {
  1043.             runTime[k]();
  1044.         }
  1045.     }
  1046. }
  1047.  
  1048. // Runs plugin functions to parse commands.
  1049. function parseCmdLine(pf, i, args) {
  1050.     if (typeof cmdLine != 'undefined' && cmdLine.length) { 
  1051.         for (var k = 0; k < cmdLine.length; k++) { 
  1052.             var j = cmdLine[k](pf, i, args);
  1053.             if (j >- 1) {
  1054.                 i = j;
  1055.                 break;
  1056.             }
  1057.         }
  1058.     }
  1059.  
  1060.     return i;
  1061. }
  1062.  
  1063. // Runs plugin functions to do things after parse.
  1064. function postParseChecks(){
  1065.     if (typeof postParse != 'undefined' && postParse.length) {
  1066.         for (var k = 0; k < postParse.length; k++) {
  1067.             if (postParse[k]()) continue;
  1068.             return false;  // end now since have an error
  1069.         }
  1070.     }
  1071.     return true;
  1072. }
  1073.  
  1074.  
  1075. ////////
  1076. //  PLUGIN REGISTRATION FUNCTIONS
  1077. ////////
  1078.  
  1079. // Registers commands and creates constants.
  1080. function registerCommands(cmdStr) {
  1081.     if (typeof cmdStr!='string') return;
  1082.  
  1083.     var pM = cmdStr.split(',');
  1084.     pms = pms.concat(pM);
  1085.  
  1086.     for (var i = 0; i< pM.length; i++) {
  1087.         eval(pM[i].toUpperCase()+'='+pmCount++);
  1088.     }
  1089. }
  1090.  
  1091. // Register a function to hook at a certain point.
  1092. function registerHook(fnHookTo, fnRef, hookType, optPm) {
  1093.     var hookPt, last = typeof optPm;
  1094.     
  1095.     if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
  1096.     if (typeof hookPts == 'undefined') hookPts = new Array();
  1097.     if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();
  1098.  
  1099.     hookPt = hookPts[fnHookTo];
  1100.  
  1101.     if (hookType != null) {
  1102.         if (hookType == FREPLACE) {
  1103.             hookPt.ovload = fnRef;  // replace normal overlib routine
  1104.             if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; 
  1105.  
  1106.         } else if (hookType == FBEFORE || hookType == FAFTER) {
  1107.             var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);
  1108.  
  1109.             if (typeof fnRef == 'object') {
  1110.                 hookPt = hookPt.concat(fnRef);
  1111.             } else {
  1112.                 hookPt[hookPt.length++] = fnRef;
  1113.             }
  1114.  
  1115.             if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);
  1116.  
  1117.         } else if (hookType == FALTERNATE) {
  1118.             if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
  1119.         }
  1120.  
  1121.         return;
  1122.     }
  1123. }
  1124.  
  1125. // Register a function that will set runtime variables.
  1126. function registerRunTimeFunction(fn) {
  1127.     if (isFunction(fn)) {
  1128.         if (typeof runTime == 'undefined') runTime = new Array();
  1129.         if (typeof fn == 'object') {
  1130.             runTime = runTime.concat(fn);
  1131.         } else {
  1132.             runTime[runTime.length++] = fn;
  1133.         }
  1134.     }
  1135. }
  1136.  
  1137. // Register a function that will handle command parsing.
  1138. function registerCmdLineFunction(fn){
  1139.     if (isFunction(fn)) {
  1140.         if (typeof cmdLine == 'undefined') cmdLine = new Array();
  1141.         if (typeof fn == 'object') {
  1142.             cmdLine = cmdLine.concat(fn);
  1143.         } else {
  1144.             cmdLine[cmdLine.length++] = fn;
  1145.         }
  1146.     }
  1147. }
  1148.  
  1149. // Register a function that does things after command parsing. 
  1150. function registerPostParseFunction(fn){
  1151.     if (isFunction(fn)) {
  1152.         if (typeof postParse == 'undefined') postParse = new Array();
  1153.         if (typeof fn == 'object') {
  1154.             postParse = postParse.concat(fn);
  1155.         } else {
  1156.             postParse[postParse.length++] = fn;
  1157.         }
  1158.     }
  1159. }
  1160.  
  1161. ////////
  1162. //  PLUGIN REGISTRATION FUNCTIONS
  1163. ////////
  1164.  
  1165. // Runs any hooks registered.
  1166. function runHook(fnHookTo, hookType) {
  1167.     var l = hookPts[fnHookTo], optPm, arS, ar = runHook.arguments;
  1168.  
  1169.     if (hookType == FREPLACE) {
  1170.         arS = argToString(ar, 2);
  1171.  
  1172.         if (typeof l == 'undefined' || !(l = l.ovload)) return eval(fnHookTo+'('+arS+')');
  1173.         else return eval('l('+arS+')');
  1174.  
  1175.     } else if (hookType == FBEFORE || hookType == FAFTER) {
  1176.         if (typeof l == 'undefined') return;
  1177.         l=(hookType == 1 ? l.before : l.after);
  1178.  
  1179.         if (!l.length) return;
  1180.  
  1181.         arS = argToString(ar, 2);
  1182.         for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')'); 
  1183.  
  1184.     } else if (hookType == FALTERNATE) {
  1185.         optPm = ar[2];
  1186.         arS = argToString(ar, 3);
  1187.  
  1188.         if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
  1189.             return eval(fnHookTo+'('+arS+')');
  1190.         } else {
  1191.             return eval('l('+arS+')');
  1192.         }
  1193.     }
  1194. }
  1195.  
  1196. ////////
  1197. //  UTILITY FUNCTIONS
  1198. ////////
  1199.  
  1200. // Checks if something is a function.
  1201. function isFunction(fnRef) {
  1202.     var rtn = true;
  1203.  
  1204.     if (typeof fnRef == 'object') {
  1205.         for (var i = 0; i < fnRef.length; i++) {
  1206.             if (typeof fnRef[i]=='function') continue;
  1207.             rtn = false;
  1208.             break;
  1209.         }
  1210.     } else if (typeof fnRef != 'function') {
  1211.         rtn = false;
  1212.     }
  1213.     
  1214.     return rtn;
  1215. }
  1216.  
  1217. // Converts an array into an argument string for use in eval.
  1218. function argToString(array, strtInd, argName) {
  1219.     var jS = strtInd, aS = '', ar = array;
  1220.     argName=(argName ? argName : 'ar');
  1221.     
  1222.     if (ar.length > jS) {
  1223.         for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
  1224.         aS = aS.substring(0, aS.length-2);
  1225.     }
  1226.     
  1227.     return aS;
  1228. }
  1229.  
  1230. // Places a hook in the correct position in a hook point.
  1231. function reOrder(hookPt, fnRef, order) {
  1232.     if (!order || typeof order == 'undefined' || typeof order == 'number') return;
  1233.     
  1234.     var newPt = new Array(), match;
  1235.  
  1236.     if (typeof order=='function') {
  1237.         if (typeof fnRef=='object') {
  1238.             newPt = newPt.concat(fnRef);
  1239.         } else {
  1240.             newPt[newPt.length++]=fnRef;
  1241.         }
  1242.         
  1243.         for (var i = 0; i < hookPt.length; i++) {
  1244.             match = false;
  1245.             if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
  1246.                 continue;
  1247.             } else {
  1248.                 for(var j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
  1249.                     match = true;
  1250.                     break;
  1251.                 }
  1252.             }
  1253.             if (!match) newPt[newPt.length++] = hookPt[i];
  1254.         }
  1255.  
  1256.         newPt[newPt.length++] = order;
  1257.  
  1258.     } else if (typeof order == 'object') {
  1259.         if (typeof fnRef == 'object') {
  1260.             newPt = newPt.concat(fnRef);
  1261.         } else {
  1262.             newPt[newPt.length++] = fnRef;
  1263.         }
  1264.         
  1265.         for (var j = 0; j < hookPt.length; j++) {
  1266.             match = false;
  1267.             if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
  1268.                 continue;
  1269.             } else {
  1270.                 for (var i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
  1271.                     match = true;
  1272.                     break;
  1273.                 }
  1274.             }
  1275.             if (!match) newPt[newPt.length++]=hookPt[j];
  1276.         }
  1277.  
  1278.         for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
  1279.         newPt.length = 0;
  1280.         
  1281.         for (var j = 0; j < hookPt.length; j++) {
  1282.             match = false;
  1283.             for (var i = 0; i < order.length; i++) {
  1284.                 if (hookPt[j] == order[i]) {
  1285.                     match = true;
  1286.                     break;
  1287.                 }
  1288.             }
  1289.             if (!match) newPt[newPt.length++] = hookPt[j];
  1290.         }
  1291.         newPt = newPt.concat(order);
  1292.     }
  1293.  
  1294.     for(i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
  1295.  
  1296.     return hookPt;
  1297. }
  1298.  
  1299. ////////
  1300. // OBJECT CONSTRUCTORS
  1301. ////////
  1302.  
  1303. // Object for handling hooks.
  1304. function FunctionReference() {
  1305.     this.ovload = null;
  1306.     this.before = new Array();
  1307.     this.after = new Array();
  1308.     this.alt = new Array();
  1309. }
  1310.  
  1311. // Object for simple access to the overLIB version used.
  1312. // Examples: simpleversion:351 major:3 minor:5 revision:1
  1313. function Info(version, prerelease) {
  1314.     this.version = version;
  1315.     this.prerelease = prerelease;
  1316.  
  1317.     this.simpleversion = Math.round(this.version*100);
  1318.     this.major = parseInt(this.simpleversion / 100);
  1319.     this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
  1320.     this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
  1321. }
  1322.  
  1323.  
  1324.  
  1325. ////////
  1326. // STANDARD REGISTRATIONS
  1327. ////////
  1328. registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
  1329. registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
  1330. registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
  1331. registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
  1332. registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
  1333. registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
  1334. registerHook("hideObject", nbspCleanup, FAFTER);
  1335. if(olNs4||(olIe5&&isMac)) olLoaded=1;
  1336.  
  1337.